001 /*
002 * Copyright 2006 Stephen J. McConnell.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
013 * implied.
014 *
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018
019 package net.dpml.library;
020
021 import net.dpml.library.info.TypeDirective;
022
023 /**
024 * Interface implemented by type datastructure builders.
025 */
026 public interface TypeBuilder
027 {
028 /**
029 * Return the id of the type produced by the builder.
030 * @return the type id
031 */
032 String getID();
033
034 /**
035 * Construct a type instance using a supplied classloader and type
036 * production directive.
037 * @param classloader the base classloader
038 * @param type the type production directive
039 * @return the type instance
040 * @exception Exception if an error occurs
041 */
042 Type buildType( ClassLoader classloader, TypeDirective type ) throws Exception;
043 }